export const state = {
  user: null,
  agent:null
}

export const mutations = {
  setUser(state, user) {
    state.user = user || null
  },
  setUserAgent(state,agent){
    state.agent = agent;
  }
}

export const getters = {
  isAuthenticated (state) {
    return !!state.user
  },
  loggedUser (state) {
    return state.user
  },
  agent(state){
    return state.agent
  }
}
export const actions = {
  setUser(context,user){
      context.commit("setUser",user);
  },
  setUserAgent(context,agent){
      context.commit("setUserAgent",agent);
  }
}